#pragma once
#include "pch.h"
#include "TcpClient.h"

struct TcpServer
{
    int sock;

    struct Desc
    {
        unsigned int port = 6666;
        unsigned int af = AF_INET;
        unsigned int type = SOCK_STREAM;
        unsigned int protocol = IPPROTO_TCP;

        unsigned int sAddr = INADDR_ANY;
        unsigned int sinFamily = AF_INET;

        unsigned int backLog = 10;
    };

    TcpClient Accept();
    bool Create(const Desc &desc);
    void Close();
};
